<template>
  <div class="left-top">
    <div class="top-bar">
      <div class="top-bar__item" v-for="(item, index) in data.统计行" :key="index">
        <div class="bar-title">{{item.名称}}:</div>
        <div class="bar-value" :style="{color: item.颜色}">{{item.值}}</div>
        <div class="bar-unit">{{item.单位}}</div>
      </div>
    </div>
    <div class="top-main">
      <screen-pie :data="data.图表"/>
    </div>
  </div>
</template>
<script>
import screenPie from '../com/screen-pie'
export default {
  name: 'left-top',
  cnName: '左上',
  components: {
    screenPie
  },
  props: {
    data: Object
  },
  data() {
    return {
    }
  },
  methods: {},
  mounted() {
  }
}
</script>
<style scoped lang="scss">
.left-top {
  height: 100%;
  position: relative;
  box-sizing: border-box;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;

  .top-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;

    &__item {
      display: flex;
    }


    .bar-value {
      margin-left: 5px;
      font-size: 20px;
    }
  }
  .top-main {
    flex: 1;
  }
}
</style>
